import Vue from 'vue'
import Router from 'vue-router'
import login from '../view/login.vue'
import home from '../view/home.vue'
import sale from '../view/sale.vue'
import welcome from '../view/welcome.vue'
import findSale from '../view/FindSale.vue'
import findStock from '../view/FindStock.vue'

Vue.use(Router)
const VueRouterPush = Router.prototype.push
Router.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
const router=new Router({
	routes:[
		{
			path:"/login",
			component:login
		},
		{
			path:"/home",
			component:home,
			children:[
				{
					path:'/sale',
					name:'sale',
					component:sale
				},
				{
					path:'/welcome',
					name:'welcome',
					component:welcome
				},
				{
					path:'/findSale',
					name:'findSale',
					component:findSale
				},
				{
					path:'/findStock',
					name:'findStock',
					component:findStock
				}
			]
		}
	]
});
export default router